Skip to content

Fix(quadlet): Ensure .app application file is removed by quadlet rm --all (#27647)#27694

Closed
kavishgr wants to merge 2 commits into
podman-container-tools:mainfrom
kavishgr:fix/issue-27647
Closed

Fix(quadlet): Ensure .app application file is removed by quadlet rm --all (#27647)#27694
kavishgr wants to merge 2 commits into
podman-container-tools:mainfrom
kavishgr:fix/issue-27647

Conversation

@kavishgr

@kavishgr kavishgr commented Dec 5, 2025

Copy link
Copy Markdown
  • Certify you wrote the patch or otherwise have the right to pass it on as an open-source patch by signing all
    commits. (git commit -s). (If needed, use git commit -s --amend). The author email must match
    the sign-off email address. See CONTRIBUTING.md
    for more information.
  • Referenced issues using Fixes: #00000 in commit message (if applicable)
  • Tests have been added/updated (or no tests are needed)
  • Documentation has been updated (or no documentation changes are needed)
  • All commits pass make validatepr (format/lint checks)
  • Release note entered in the section below (or None if no user-facing changes)

Does this PR introduce a user-facing change?

None

Fixes: #27647

Note on Dependencies:

This PR is dependent on the changes from issue #27653, as outlined in PR #27693. Once #27693 merges, I will rebase and push the changes here.

What I did (quadlet.go file):

  • Fixed reverseMap lookup by using the base filename instead of the full path, since reverseMap keys are filenames only

  • Added conditional path handling when expanding quadlets from .app files - use full paths when --all flag is set (since getAllQuadletPaths returns full paths), but use just filenames otherwise (since getQuadletPathByName expects filenames)

  • Moved the cleanup of .app and .asset metadata files outside the main quadlet removal loop. Previously these files were being left behind because they aren't included in allQuadletPaths. Now they're properly removed after all quadlets have been processed

  • Added logging for the files being removed

These changes fix the issue where .app files were not being deleted during removal(podman quadlet --all --force), and also resolve path resolution errors when removing individual apps (e.g., podman quadlet rm .nginx-test.app).

Test:

  • The test verifies that the podman quadlet rm -af command correctly removes all quadlet files.

@openshift-ci openshift-ci Bot added the do-not-merge/release-note-label-needed Enforce release-note requirement, even if just None label Dec 5, 2025
@openshift-ci

openshift-ci Bot commented Dec 5, 2025

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: kavishgr
Once this PR has been reviewed and has the lgtm label, please assign honny1 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Honny1 Honny1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a quick check of the CI failure. I also fixed the release note format in the PR description.

Comment thread pkg/domain/infra/abi/quadlet.go Outdated
@openshift-ci openshift-ci Bot added release-note-none and removed do-not-merge/release-note-label-needed Enforce release-note requirement, even if just None labels Dec 5, 2025
kavishgr added a commit to kavishgr/podman that referenced this pull request Dec 5, 2025
…ntainer-tools#27653)

Fix: removed return statement, which was originally added for logging. Logrus handles the logging(in its related PR podman-container-tools#27694).

Signed-off-by: Kavish Gour <kavishgr@protonmail.com>
@kavishgr

kavishgr commented Dec 8, 2025

Copy link
Copy Markdown
Author

This PR now includes all necessary changes. We should abandon PR #27693 and only merge this current one.

@Honny1 Honny1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code LGTM. However, I have a question about the tests: is there a specific reason they weren't implemented in quadlet_test.go?

@kavishgr

kavishgr commented Dec 8, 2025

Copy link
Copy Markdown
Author

The code LGTM. However, I have a question about the tests: is there a specific reason they weren't implemented in quadlet_test.go?

On a closed PR regarding quadlets, a collaborator suggested that all quadlet tests should go into 36-quadlets.at. I think I might’ve misunderstood that, sorry about the mix up. I can write it in Ginkgo. I recently ran one and it passed. I can implement the rm -af tests using Podman commands, and we can keep the Libpod API test as it is

@ygalblum ygalblum left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small nit

Comment thread test/apiv2/36-quadlets.at Outdated
#
# Install quadlets(.container, .network, .volume)

quadlet_name=quadlet-rm-test-$(cat /proc/sys/kernel/random/uuid)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use safename (defined in helpers.bash)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. Thanks.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, my bad, I though this was a bats test. I'm not sure this one has the safename

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries. I've updated the test name to quadlet-remove-all-test to keep it consistent.

@Honny1

Honny1 commented Dec 8, 2025

Copy link
Copy Markdown
Contributor

The code LGTM. However, I have a question about the tests: is there a specific reason they weren't implemented in quadlet_test.go?

On a closed PR regarding quadlets, a collaborator suggested that all quadlet tests should go into 36-quadlets.at. I think I might’ve misunderstood that, sorry about the mix up. I can write it in Ginkgo. I recently ran one and it passed. I can implement the rm -af tests using Podman commands, and we can keep the Libpod API test as it is

Yes, please write a simple test in Ginkgo.

@kavishgr kavishgr force-pushed the fix/issue-27647 branch 2 times, most recently from 7583fd1 to bc3a8f0 Compare December 8, 2025 18:32
@packit-as-a-service

Copy link
Copy Markdown

[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore.

2 similar comments
@packit-as-a-service

Copy link
Copy Markdown

[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore.

@packit-as-a-service

Copy link
Copy Markdown

[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore.

Comment thread test/e2e/quadlet_test.go

@Honny1 Honny1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, please rebase on main.

@kavishgr

Copy link
Copy Markdown
Author

LGTM, please rebase on main.

Done. Rebased on latest main.

Comment thread test/e2e/quadlet_test.go Outdated

installSession := podmanTest.Podman([]string{"quadlet", "install", tmpDir})
installSession.WaitWithDefaultTimeout()
Expect(installSession).Should(Exit(0))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still fails on F43. I am not sure where the problem could be.

[FAIL] quadlet system generator Running quadlet force remove all [It] Should remove all quadlets at once
[+0894s]   /var/tmp/go/src/github.com/containers/podman/test/e2e/quadlet_test.go:1360

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran the tests and they passed on my end. Here is the output:

❯ sudo ginkgo -v -focus "Running quadlet force remove all" test/e2e
Running Suite: Libpod Suite - /home/kavish/podman/test/e2e
==========================================================
Random Seed: 1766421735

Will run 1 of 2443 specs
------------------------------
[SynchronizedBeforeSuite]
/home/kavish/podman/test/e2e/common_test.go:169
  [image already cached: /var/tmp/quay.io-libpod-cirros-latest.tar]
  [image already cached: /var/tmp/quay.io-libpod-volume-plugin-test-img-20220623.tar]
  [image already cached: /var/tmp/quay.io-libpod-alpine-latest.tar]
  [image already cached: /var/tmp/quay.io-libpod-busybox-latest.tar]
  [image already cached: /var/tmp/quay.io-libpod-systemd-image-20240124.tar]
  [image already cached: /var/tmp/quay.io-lsm5-alpine_nginx-aarch64-latest.tar]
  [image already cached: /var/tmp/quay.io-libpod-redis-alpine.tar]
  [image already cached: /var/tmp/quay.io-libpod-registry-2.8.2.tar]
  [image already cached: /var/tmp/quay.io-libpod-k8s-pause-3.5.tar]
  [image already cached: /var/tmp/quay.io-libpod-testimage-20241011.tar]
  [image already cached: /var/tmp/quay.io-libpod-alpine_healthcheck-latest.tar]
  [image already cached: /var/tmp/quay.io-libpod-systemd-image-20240124.tar]
  Restoring quay.io/libpod/alpine:latest...
  Running: /home/kavish/podman/bin/podman --root /tmp/podman-e2e-554133839/imagecachedir --runroot /tmp/podman-e2e-554133839/image-init/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /etc/containers/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-554133839/image-init --events-backend none --storage-driver overlay load -q -i /var/tmp/quay.io-libpod-alpine-latest.tar
  Loaded image: quay.io/libpod/alpine:latest
  Restoring quay.io/libpod/busybox:latest...
  Running: /home/kavish/podman/bin/podman --root /tmp/podman-e2e-554133839/imagecachedir --runroot /tmp/podman-e2e-554133839/image-init/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /etc/containers/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-554133839/image-init --events-backend none --storage-driver overlay load -q -i /var/tmp/quay.io-libpod-busybox-latest.tar
  Loaded image: quay.io/libpod/busybox:latest
  Restoring quay.io/libpod/systemd-image:20240124...
  Running: /home/kavish/podman/bin/podman --root /tmp/podman-e2e-554133839/imagecachedir --runroot /tmp/podman-e2e-554133839/image-init/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /etc/containers/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-554133839/image-init --events-backend none --storage-driver overlay load -q -i /var/tmp/quay.io-libpod-systemd-image-20240124.tar
  Loaded image: quay.io/libpod/systemd-image:20240124
  Restoring quay.io/lsm5/alpine_nginx-aarch64:latest...
  Running: /home/kavish/podman/bin/podman --root /tmp/podman-e2e-554133839/imagecachedir --runroot /tmp/podman-e2e-554133839/image-init/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /etc/containers/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-554133839/image-init --events-backend none --storage-driver overlay load -q -i /var/tmp/quay.io-lsm5-alpine_nginx-aarch64-latest.tar
  Loaded image: quay.io/lsm5/alpine_nginx-aarch64:latest
  Restoring quay.io/libpod/redis:alpine...
  Running: /home/kavish/podman/bin/podman --root /tmp/podman-e2e-554133839/imagecachedir --runroot /tmp/podman-e2e-554133839/image-init/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /etc/containers/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-554133839/image-init --events-backend none --storage-driver overlay load -q -i /var/tmp/quay.io-libpod-redis-alpine.tar
  Loaded image: quay.io/libpod/redis:alpine
  Restoring quay.io/libpod/registry:2.8.2...
  Running: /home/kavish/podman/bin/podman --root /tmp/podman-e2e-554133839/imagecachedir --runroot /tmp/podman-e2e-554133839/image-init/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /etc/containers/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-554133839/image-init --events-backend none --storage-driver overlay load -q -i /var/tmp/quay.io-libpod-registry-2.8.2.tar
  Loaded image: quay.io/libpod/registry:2.8.2
  Restoring quay.io/libpod/k8s-pause:3.5...
  Running: /home/kavish/podman/bin/podman --root /tmp/podman-e2e-554133839/imagecachedir --runroot /tmp/podman-e2e-554133839/image-init/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /etc/containers/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-554133839/image-init --events-backend none --storage-driver overlay load -q -i /var/tmp/quay.io-libpod-k8s-pause-3.5.tar
  Loaded image: quay.io/libpod/k8s-pause:3.5
  Restoring quay.io/libpod/testimage:20241011...
  Running: /home/kavish/podman/bin/podman --root /tmp/podman-e2e-554133839/imagecachedir --runroot /tmp/podman-e2e-554133839/image-init/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /etc/containers/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-554133839/image-init --events-backend none --storage-driver overlay load -q -i /var/tmp/quay.io-libpod-testimage-20241011.tar
  Loaded image: quay.io/libpod/testimage:20241011
  Restoring quay.io/libpod/alpine_healthcheck:latest...
  Running: /home/kavish/podman/bin/podman --root /tmp/podman-e2e-554133839/imagecachedir --runroot /tmp/podman-e2e-554133839/image-init/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /etc/containers/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-554133839/image-init --events-backend none --storage-driver overlay load -q -i /var/tmp/quay.io-libpod-alpine_healthcheck-latest.tar
  Loaded image: quay.io/libpod/alpine_healthcheck:latest
  Restoring quay.io/libpod/systemd-image:20240124...
  Running: /home/kavish/podman/bin/podman --root /tmp/podman-e2e-554133839/imagecachedir --runroot /tmp/podman-e2e-554133839/image-init/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /etc/containers/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-554133839/image-init --events-backend none --storage-driver overlay load -q -i /var/tmp/quay.io-libpod-systemd-image-20240124.tar
  Loaded image: quay.io/libpod/systemd-image:20240124
  -----------------------------
[SynchronizedBeforeSuite] PASSED [3.831 seconds]
------------------------------
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
------------------------------
quadlet system generator Running quadlet force remove all Should remove all quadlets at once
/home/kavish/podman/test/e2e/quadlet_test.go:1339
  Running: /home/kavish/podman/bin/podman --storage-opt overlay.imagestore=/tmp/podman-e2e-554133839/imagecachedir --root /tmp/podman-e2e-554133839/subtest-3789943928/p/root --runroot /tmp/podman-e2e-554133839/subtest-3789943928/p/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /etc/containers/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-554133839/subtest-3789943928/p --events-backend file --storage-driver overlay quadlet install /tmp/podman-e2e-554133839/subtest-3789943928/p/quadlet-remove-all-test-1766421735
  /etc/containers/systemd/quadlet-remove-all-test-1766421735.volume
  /etc/containers/systemd/quadlet-remove-all-test-1766421735.container
  /etc/containers/systemd/quadlet-remove-all-test-1766421735.network
  Running: /home/kavish/podman/bin/podman --storage-opt overlay.imagestore=/tmp/podman-e2e-554133839/imagecachedir --root /tmp/podman-e2e-554133839/subtest-3789943928/p/root --runroot /tmp/podman-e2e-554133839/subtest-3789943928/p/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /etc/containers/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-554133839/subtest-3789943928/p --events-backend file --storage-driver overlay quadlet list --format json
  [
    {
      "Name": "quadlet-remove-all-test-1766421735.container",
      "UnitName": "quadlet-remove-all-test-1766421735.service",
      "Path": "/etc/containers/systemd/quadlet-remove-all-test-1766421735.container",
      "Status": "inactive/dead",
      "App": ".quadlet-remove-all-test-1766421735.app"
    },
    {
      "Name": "quadlet-remove-all-test-1766421735.network",
      "UnitName": "quadlet-remove-all-test-1766421735-network.service",
      "Path": "/etc/containers/systemd/quadlet-remove-all-test-1766421735.network",
      "Status": "inactive/dead",
      "App": ".quadlet-remove-all-test-1766421735.app"
    },
    {
      "Name": "quadlet-remove-all-test-1766421735.volume",
      "UnitName": "quadlet-remove-all-test-1766421735-volume.service",
      "Path": "/etc/containers/systemd/quadlet-remove-all-test-1766421735.volume",
      "Status": "inactive/dead",
      "App": ".quadlet-remove-all-test-1766421735.app"
    }
  ]
  Running: /home/kavish/podman/bin/podman --storage-opt overlay.imagestore=/tmp/podman-e2e-554133839/imagecachedir --root /tmp/podman-e2e-554133839/subtest-3789943928/p/root --runroot /tmp/podman-e2e-554133839/subtest-3789943928/p/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /etc/containers/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-554133839/subtest-3789943928/p --events-backend file --storage-driver overlay quadlet rm -af
  quadlet-remove-all-test-1766421735.container
  quadlet-remove-all-test-1766421735.network
  quadlet-remove-all-test-1766421735.volume
  Running: /home/kavish/podman/bin/podman --storage-opt overlay.imagestore=/tmp/podman-e2e-554133839/imagecachedir --root /tmp/podman-e2e-554133839/subtest-3789943928/p/root --runroot /tmp/podman-e2e-554133839/subtest-3789943928/p/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /etc/containers/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-554133839/subtest-3789943928/p --events-backend file --storage-driver overlay quadlet list --format json
  []
  Running: /home/kavish/podman/bin/podman --storage-opt overlay.imagestore=/tmp/podman-e2e-554133839/imagecachedir --root /tmp/podman-e2e-554133839/subtest-3789943928/p/root --runroot /tmp/podman-e2e-554133839/subtest-3789943928/p/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /etc/containers/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-554133839/subtest-3789943928/p --events-backend file --storage-driver overlay stop --all -t 0
  Running: /home/kavish/podman/bin/podman --storage-opt overlay.imagestore=/tmp/podman-e2e-554133839/imagecachedir --root /tmp/podman-e2e-554133839/subtest-3789943928/p/root --runroot /tmp/podman-e2e-554133839/subtest-3789943928/p/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /etc/containers/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-554133839/subtest-3789943928/p --events-backend file --storage-driver overlay pod rm -fa -t 0
  Running: /home/kavish/podman/bin/podman --storage-opt overlay.imagestore=/tmp/podman-e2e-554133839/imagecachedir --root /tmp/podman-e2e-554133839/subtest-3789943928/p/root --runroot /tmp/podman-e2e-554133839/subtest-3789943928/p/runroot --runtime crun --conmon /usr/bin/conmon --network-config-dir /etc/containers/networks --network-backend netavark --cgroup-manager systemd --tmpdir /tmp/podman-e2e-554133839/subtest-3789943928/p --events-backend file --storage-driver overlay rm -fa -t 0
• [0.578 seconds]
------------------------------
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
------------------------------
[SynchronizedAfterSuite]
/home/kavish/podman/test/e2e/common_test.go:235
  integration timing results
  quadlet system generator Running quadlet force remove all Should remove all quadlets at once	0.523858
[SynchronizedAfterSuite] PASSED [0.177 seconds]
------------------------------

Ran 1 of 2443 Specs in 4.624 seconds
SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 2442 Skipped
PASS

Ginkgo ran 1 suite in 8.290264111s
Test Suite Passed

I also verified this against the latest main branch, and it passed there as well. Even with sudo ginkgo run -v --focus-file=quadlet_test.go test/e2e/, it’s still passing:

OUTPUT REDACTED

 quadlet system generator Running success quadlet test case logopt.container		0.013379
  quadlet system generator Running success quadlet test case label.container		0.013625
  quadlet system generator Running success quadlet test case exec.container		0.013705
  quadlet system generator Running success quadlet test case pull.container		0.013814
  quadlet system generator Running success quadlet test case readonly-notmpfs.container		0.014216
  quadlet system generator Running success quadlet test case capabilities.container		0.014951
  quadlet system generator Running quadlet force remove all Should remove all quadlets at once	0.503787
[SynchronizedAfterSuite] PASSED [0.175 seconds]
------------------------------

Ran 301 of 2443 Specs in 26.713 seconds
SUCCESS! -- 301 Passed | 0 Failed | 0 Pending | 2142 Skipped
PASS

Ginkgo ran 1 suite in 31.515989818s
Test Suite Passed

I'm not sure why it's failing.

@kavishgr kavishgr Dec 23, 2025

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed the test was using Exit(0) in several places. I've updated it to use ExitCleanly() instead, which is the recommended Ginkgo matcher. This might resolve the F43 failure. I will push soon and see what's up.

Update: Done.

Comment thread test/apiv2/36-quadlets.at
Comment thread test/e2e/quadlet_test.go Outdated
@Honny1

Honny1 commented Dec 23, 2025

Copy link
Copy Markdown
Contributor

Not sure about the F43 failure, but the other tests appear to be flaky.

[FAIL] quadlet system generator Running quadlet force remove all [It] Should remove all quadlets at once
[+0894s]   /var/tmp/go/src/github.com/containers/podman/test/e2e/quadlet_test.go:1360

PTAL @mheon @Luap99

@kavishgr

Copy link
Copy Markdown
Author

Ping. Is there anything else you need from my side to move this forward ?

@Honny1

Honny1 commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

Code LGTM. The CI failure appears legitimate, but I'm not sure how to resolve it. @containers/podman-maintainers @lsm5, could you take a look? Any ideas?

@Honny1

Honny1 commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

PTAL @containers/podman-maintainers

@kavishgr

kavishgr commented Apr 23, 2026

Copy link
Copy Markdown
Author

I think maybe the error is because the overlay mount wasn't fully torn down before AfterSuite tried to wipe the temp dir(output redacted):

unlinkat /tmp/CI_**/podman-e2e-.../subtest-**/p/root/overlay/**: directory not empty
< Exit [SynchronizedAfterSuite] TOP-LEVEL - /var/tmp/go/src/github.com/containers/podman/test/e2e/common_test.go:237

Looks like a DeferCleanup might be needed after podman install but I'm not totally sure:

DeferCleanup(func() {
    podmanTest.PodmanExitCleanly("stop", "-a", "-t", "0")
    podmanTest.PodmanExitCleanly("quadlet", "rm", "-af")
})

@Honny1

Honny1 commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

That could be it. But anyway, please rebase on main; we changed import paths.

@packit-as-a-service

Copy link
Copy Markdown

tmt tests failed for commit 3248d1e. @lsm5, @psss, @thrix please check.

@kavishgr

Copy link
Copy Markdown
Author

The unlinkat error is still persisting, I'm removing the DeferCleanup.

@packit-as-a-service

Copy link
Copy Markdown

tmt tests failed for commit ad27bb4. @lsm5, @psss, @thrix please check.

@Honny1 Honny1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I found it.

Comment thread test/e2e/quadlet_test.go
@packit-as-a-service

Copy link
Copy Markdown

tmt tests failed for commit 24afe40. @lsm5, @psss, @thrix please check.

@packit-as-a-service

Copy link
Copy Markdown

tmt tests failed for commit 4f4c8b6. @lsm5, @psss, @thrix please check.

@packit-as-a-service

Copy link
Copy Markdown

[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore.

@packit-as-a-service

Copy link
Copy Markdown

tmt tests failed for commit 4f4c8b6. @lsm5, @psss, @thrix please check.

@Honny1 Honny1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM

PTAL @containers/podman-maintainers

@psss

psss commented Apr 29, 2026

Copy link
Copy Markdown

tmt tests failed for commit 4f4c8b6. @lsm5, @psss, @thrix please check.

Could you please rebase on the latest main?

…ntainer-tools#27653)

Refactor removelist into sets

Add quadlet rm --all test with safename

add an integration test for quadlet rm --all(skip for remote clients)

Signed-off-by: Kavish Gour <kavishgr@protonmail.com>
Ensure that the --all (-a) flag cannot be used simultaneously with specific quadlet arguments on the CLI. This prevents logical conflicts when a user provides both the --all flag and specific quadlets.

- Add validation check in cmd/podman/quadlet/remove.go
- Update the docs to document this behaviour with an example
- Improve user feedback by explicitly stating why the command failed

Signed-off-by: Kavish Gour <kavishgr@protonmail.com>
@kavishgr

Copy link
Copy Markdown
Author

@psss Done. Rebased on latest main.

@packit-as-a-service

Copy link
Copy Markdown

[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore.

@kavishgr kavishgr requested a review from Honny1 May 8, 2026 06:41
Comment thread cmd/podman/quadlet/remove.go
Comment thread cmd/podman/quadlet/remove.go
Comment thread pkg/domain/infra/abi/quadlet.go

// Remove .app and .asset files after the main quadlet removal loop
// This ensures they are cleaned up properly since they are not included in allQuadletPaths
for entry := range removeSet {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not blocking: metadata files in removeSet are cleaned up regardless of whether the associated quadlet removals succeeded. If all quadlets in an app fail to remove (e.g., running without --force), the .app file is still deleted, orphaning them. This was the same behavior before this PR, just noting it as something to potentially address in a follow-up.

@Honny1

Honny1 commented May 12, 2026

Copy link
Copy Markdown
Contributor

PTAL @containers/podman-maintainers @containers/podman-reviewers

@l0rd

l0rd commented May 12, 2026

Copy link
Copy Markdown
Contributor

We want to remove support for .app files per #28335. In that PR, applications' files will be removed when using quadlet rm --all.

I am afraid that we should close this one.

@kavishgr

Copy link
Copy Markdown
Author

Cool. Thanks for the update and thanks for the guidance throughout this PR. Closing this now.

@kavishgr kavishgr closed this May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Quadlet: application file not removed upon quadlet removal with --all flag

7 participants